home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: jritzau@aol.com (JRitzau)
- Newsgroups: comp.lang.c++
- Subject: ifstream slower than fread()?
- Date: 12 Jan 1996 20:00:31 -0500
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4d707f$j2@newsbf02.news.aol.com>
- Reply-To: jritzau@aol.com (JRitzau)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- Hello!
-
- I was thinking iostreams of C++ are the best way to read
- and write binary files. But after testing I must see, that
- to copy a file with 'old' C-functions fwrite()/fread() do
- the job in just about half the time it was done using
- ifstream.read()/ofstream.write()?!
-
- Is this a common disadvantage of streams or does this depend
- on the C++ Compiler used? I'm working with Borland Turbo
- C++ 3.0 for DOS.
-
- Next problem: I've read that I must call the function
- ios::sync_with_stdio() if one program uses printf() AND cout.
-
- Is there also a need for this synchronisation if I use
- fread()/fwrite() (no printf()) AND cin/cout in the same
- program?
-
-
- Thanks for any hints.
- Juergen
-